package com.jnc.core.properties;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Auther: jjn
 * @Date: 2020/7/31
 * @Desc:
 */
@Setter
@Getter
@ConfigurationProperties(prefix = "sys")
public class GlobalProperties {

    private String genAuthor;
    private String genPackageName;
    private String genGetTablePrefix;
    private String genAutoRemoveTableNamePre;

    /**
     * 代码生成包路径
     * @return
     */
    public String getPackageName(){
        return getGenPackageName() != null ? getGenPackageName() : "com.jnc.web.biz.business";
    }

    /**
     * 获取Gen作者
     * @return
     */
    public String getAuthor(){
        return getGenAuthor() != null ? getGenAuthor() : "jjn";
    }

    /**
     * 是否自动去除表前缀
     * @return
     */
    public String getAutoRemoveTableNamePre(){
        return getGenAutoRemoveTableNamePre() != null ? getGenAutoRemoveTableNamePre() : "yes";
    }

    /**
     * 获取表前缀(类名不会包含表前缀)
     * @return
     */
    public String getTablePrefix(){
        return getGenGetTablePrefix() != null ? getGenGetTablePrefix() : "sys_";
    }
}
